package com.cy.law.db.dao;

import com.cy.law.db.entity.HumanNavItem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface HumanNavItemDao extends JpaRepository<HumanNavItem, Integer> {

    @Query("select b from com.cy.law.db.entity.NavItem a,HumanNavItem b  where a.navId = b.navId and b.humanId = ?1 order by display_order asc")
    List<HumanNavItem> findHumanNavItems(int humanId);

    int countAllByHumanIdAndNavId(int humanId, int navId);
}
